<template>
    <el-col :span="2">
        <h3>学科</h3>
        <el-menu
                default-active="2"
                class="el-menu-vertical-demo"
                >
            <el-menu-item v-for="(item) in itemList" @click="clickItem(item)">
                <template slot="title" >
                    {{item.name}}
                </template>
            </el-menu-item>

        </el-menu>
    </el-col>
</template>

<script>
    export default {
        name: "cliMenu",
        data(){
            return{
                itemList:[{'id':1,'name':'语文'},
                    {'id':2,'name':'数学'},
                    {'id':3,'name':'英语'},
                    {'id':4,'name':'物理'},
                    {'id':5,'name':'化学'},
                    {'id':6,'name':'生物'},
                    {'id':7,'name':'历史'},
                    {'id':8,'name':'政治'},
                    {'id':9,'name':'地理'},
                ]
            }
        },
        methods:{
            clickItem(item){
                console.log(item)
            }
        }
    }
</script>

<style scoped>

</style>